<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('结清')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form id="form-detail-edit" style="font-size: 15px">
        <div class="form-group">
            <label class="col-xs-4 control-label text-right">水电师傅：</label>
            <div class="col-xs-6">
                <label class="text-left" th:text="${hhOrder.workerName}"></label>
            </div>
        </div>
        <div class="form-group">
            <label>&nbsp;&nbsp;&nbsp;</label>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label text-right">客户名称：</label>
            <div class="col-xs-6">
                <label class="text-left" th:text="${hhOrder.consumerName}"></label>
            </div>
        </div>
        <div class="form-group">
            <label>&nbsp;&nbsp;&nbsp;</label>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label text-right">累计金额：</label>
            <div class="col-xs-6">
                <label class="text-left" th:text="${hhOrder.totalMoney}"></label>
            </div>
        </div>
        <div class="form-group">
            <label>&nbsp;&nbsp;&nbsp;</label>
        </div>
        <div class="form-group">
            <label class="col-xs-4">&nbsp;&nbsp;&nbsp;</label>
            <div class="col-xs-6 text-left">
                <button class="btn btn-warning" type="button" onclick="orderClear()"><i class="glyphicon glyphicon-yen"></i>&nbsp;确认结清</button>
            </div>
        </div>
        <div class="form-group">
            <label>&nbsp;&nbsp;&nbsp;</label>
        </div>

    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var hhOrder = [[${hhOrder}]];

    function orderClear() {
        $.ajax({
            type: "post",
            url: ctx + "close/manage/clear",
            data: {
                "orderId": hhOrder.orderId
            },
            success: function (result) {
                if (result.code == 0) {
                    $.modal.alertSuccess("本单已结清！");
                    setTimeout(function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }, 500);
                }
            }
        })
    }
</script>
</body>
</html>